package com.demo.com.highavailability.executor;

/**
 * 隔离任务执行器
 * 在独立线程中执行非关键任务，防止影响主流程
 */
public class IsolatedTaskExecutor {

    public static void executeInIsolation(Runnable task) {
        Thread thread = new Thread(() -> {
            try {
                task.run();
            } catch (Exception e) {
                System.err.println("隔离线程执行失败：" + e.getMessage());
            }
        });
        thread.setName("isolated-business-thread");
        thread.start();
    }
}